Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: errors from InfluxDB 1.8 being empty #138

Merged
merged 1 commit into from
Jun 29, 2020

Conversation

diamondburned
Copy link
Contributor

@diamondburned diamondburned commented Jun 24, 2020

This PR fixes errors from InfluxDB 1.8 being empty. It does this by falling back to reading the X-Influxdb-Error, and if that doesn't work, then http.Error would return the unexpected status code inside the error message.

Before PR:

before PR screenshot

After PR:

after PR screenshot

  • CHANGELOG.md updated
  • Rebased/mergeable
  • Tests pass
  • Sign CLA (if not already signed)

@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2020

Codecov Report

Merging #138 into master will decrease coverage by 0.21%.
The diff coverage is 70.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #138      +/-   ##
==========================================
- Coverage   78.88%   78.66%   -0.22%     
==========================================
  Files          26       26              
  Lines        1776     1772       -4     
==========================================
- Hits         1401     1394       -7     
- Misses        247      250       +3     
  Partials      128      128              
Impacted Files Coverage Δ
internal/http/service.go 71.73% <25.00%> (-2.99%) ⬇️
internal/http/error.go 100.00% <100.00%> (ø)
api/write/ext.go 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 787ea0b...ebf4ac2. Read the comment docs.

@diamondburned diamondburned changed the title Fix errors from InfluxDB 1.8 being empty fix: errors from InfluxDB 1.8 being empty Jun 25, 2020
@vlastahajek vlastahajek self-requested a review June 25, 2020 11:30
Copy link
Contributor

@vlastahajek vlastahajek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. LGTM.
Please, add a Changelog entry and a test (e.g. sth like this)

Squashed from 4 commits:
- Added an HTTP error fallback to X-Influxdb-Error
- Added a final default fallback for the HTTP Error
- Added tests for Influx 1.8 and fallback errors
- Added this PR to changelogs
@diamondburned
Copy link
Contributor Author

I genuinely have no idea why the tests are failing somewhere else after only adding 2 more tests.

@vlastahajek
Copy link
Contributor

Thanks for the update. Don't worry about the tests. There is a change between beta 12 and beta 13 that made some tests failing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants